package cn.modoumama.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import cn.modoumama.socket.Message;
import cn.modoumama.web.websocket.MyWebSocket;

/**
 * 定时器
 * @author XuJijun
 * 
 */
@Component
public class Scheduler {
	protected static final Logger logger = LoggerFactory.getLogger(Scheduler.class);
	
	
	
	@Scheduled(cron="0 0/1 * * * ?") //每分钟执行一次
	public void statusCheck() {
		Message message = new Message();
		message.setToFrom("2563");
		message.setFromTo("系统");
		message.setMessage("主动推送消息："+System.currentTimeMillis());
		
		MyWebSocket.sendMsg(message);
	}
}
